import random

class RandomInt:
    @classmethod
    def randint(self,num=3,a=0,b=100):
        return [random.randint(a,b) for i in range(num)]

class PrintableMixin:
    def print(self):
        lst=[(self[n],self[n+1]) for n in range(0,len(self)-1,2)]
        print(lst)

class PrintableRandomInt(PrintableMixin,RandomInt):
    pass


PrintableRandomInt.print(RandomInt.randint(20))

# 做得不错，还用到mixin
